package com.opo5.logisticsmanagement.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.opo5.logisticsmanagement.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author wangzhongwei
 */
@Mapper
public interface LoginDao extends BaseMapper<User> {
    @Select("select * from tbs_user where nickname=#{user.nickname}")
    User findByNickname(@Param("user") User user);

    @Select("select menu_id from tbs_role_menu where role_id=(select role_id from tbs_user where nickname=#{user.nickname});")
    List<Integer> findRole(@Param("user") User user);

    @Select("select id,nickname,username,gender,entrydate,resignationdate,phonenum,state from tbs_user where nickname=#{user.nickname}")
    User findByNickName(@Param("user") User user);
}
